import ctypes
import numpy as np
import os

os.system("g++ -o libpycalls2.so -shared -fPIC s2.cpp -m64")
dll = ctypes.cdll.LoadLibrary
lib = dll('./libpycalls2.so')
lib.test_print()

distance = np.zeros(3, dtype=np.float)
distance_1 = distance.ctypes.data_as(ctypes.POINTER(ctypes.c_double))
a = np.array([1, 2, 3], dtype=np.float)
a_1 = a.ctypes.data_as(ctypes.POINTER(ctypes.c_double))
b = np.array([[1, 2, 3], [2, 3, 4], [3, 4, 5]], dtype=np.float)
b_1 = b.ctypes.data_as(ctypes.POINTER(ctypes.c_double))
lib.hehe(distance_1, a_1, b_1, 3, 3)
print(distance)
os.system("rm ./libpycalls2.so")
